package com.gadgets.busi.bm08.common.dto;

import com.gadgets.busi.bm08.pojo.HdsQuestion;

/**
 * 功能说明：级别维度分值设置
 * 软件版权：恒生电子股份有限公司
 *
 * @author xiujunqing
 * @version V202101.00.000
 * @data 2022-05-24
 * 修改记录：  修改日期          修改人员    修改说明
 * 2022-05-24  xiujunqing   创建文件
 */
public class DimensionLevelDTO {

	/**
	 * 入职题分值
	 */
	private int induction;
	/**
	 * 简单题分值
	 */
	private int simple;
	/**
	 * 一般题分值
	 */
	private int commonly;

	public int getInduction() {
		return induction;
	}

	public void setInduction(int induction) {
		this.induction = induction;
	}

	public int getSimple() {
		return simple;
	}

	public void setSimple(int simple) {
		this.simple = simple;
	}

	public int getCommonly() {
		return commonly;
	}

	public void setCommonly(int commonly) {
		this.commonly = commonly;
	}

	public int getTotalScore() {
		return induction + simple + commonly;
	}

	public void calculatePoint(HdsQuestion hds, int direction) {
		int point = hds.getPoint() * direction;
		if (1 == hds.getLevel()) {
			//入职
			this.induction = this.induction + point;
		}else if (2 == hds.getLevel()) {
			//简单
			this.simple = this.simple + point;
		}else if (3 == hds.getLevel()) {
			//一般
			this.commonly = this.commonly + point;
		}
	}

	public String toStringPoint() {
		String str = "";
		if (this.induction > 0) {
			str = str + "入职:"+this.induction+"分 ";
		}
		if (this.simple > 0) {
			str = str + "简单:"+this.simple+"分 ";
		}
		if (this.commonly > 0) {
			str = str + "一般:"+this.commonly+"分 ";
		}
		return str;
	}
}
